<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>Sign++免费网络验证 后台管理</title>
    <link rel="shortcut icon" href="/favicon.ico">
    <meta name="keywords" content="sign++ 云网络验证系统 软件验证 脚本验证">
    <meta name="description" content="免费的网络验证系统 提卡免费 可以管理多个软件 功能丰富">
    <link rel="stylesheet" href="/Public/css/a100e2e6.app.css">
    <link rel="stylesheet" href="/Public/css/common.css">
    <script src="/Public/js/jquery-1.9.1.min.js"></script>
    <script src="/Public/js/bootstrap.min.js"></script>
    <script src="/Public/js/common.js"></script>
</head>
<style>
    .right-container button {
        margin-bottom: 10px;
        display: block;
    }

    .right-container table {
        width: 100%;
    }

    .right-container table th {
        height: 35px;
        background: #f7f7f7;
        color: #666;
        text-align: center;
    }

    .right-container table td {
        height: 30px;
        color: #999;
        text-align: center;
        border-bottom: 1px solid #f0f0f0;
    }

    .right-container table td.opera div {
        width: 104px;
        height: 36px;
        margin: 0 auto;
    }

    .right-container table td button {
        float: left;
        margin-bottom: 0;
        margin-top: 3px;
    }

    .right-container table td button:nth-child(2) {
        margin-left: 12px;
    }

    .pagination:nth-child(2) {
        margin-left: 12px;
    }

    nav.page {
        width: 100%;
        height: 79px;
        text-align: center;
    }
</style>
<body>

<include file="Application/Home/View/Common/Navigation.html"/>
<include file="Application/Home/View/Common/Sidebar.html"/>

<div class="right-container">
    <button type="submit" name="create" class="btn btn-primary" onclick="window.location.href='changesoft'">新建软件</button>
    <table>
        <th>名称</th>
        <th>编号</th>
        <th>版本</th>
        <th>绑定模式</th>
        <th>解绑模式</th>
        <th>更新模式</th>
        <th>软件状态</th>
        <th>操作</th>
        <volist name="list" id="vo">
            <tr>
                <td>{$vo.name}</td>
                <td>{$vo.id}</td>
                <td>{$vo.version}</td>
                <td class="bindmode">{$vo.bindmode}</td>
                <td class="unbindmode">{$vo.unbindmode}</td>
                <td class="updatemode">{$vo.updatemode}</td>
                <td class="frozen">{$vo.frozen}</td>
                <td class="opera">
                    <div>
                        <button type="button" class="btn btn-default btn-sm" onclick="window.location.href='changesoft?sid={$vo.id}'">修改</button>
                        <button type="button" class="btn btn-danger btn-sm" onclick="deleteSoft('{$vo.id}')">删除</button>
                    </div>
                </td>
            </tr>
        </volist>
    </table>
    <nav class="page">
        <div>
            <ul class="pagination">
                {$firstbtn}
                {$pagelist}
                {$lastbtn}
            </ul>
            <ul class="pagination">
                {$prevbtn}
                {$nextbtn}
            </ul>
        </div>
    </nav>
</div>
</body>
<script>
    function deleteSoft(id) {
        if(confirm("该软件下的所有注册码也将会被删除!\n确定删除该软件吗?")){
            if ('{$querystr}' != '') {
                window.location.href = 'managesoft?{$querystr}' + '&delsid=' + id;
            } else {
                window.location.href = 'managesoft?delsid=' + id;
            }
        }
    }
    window.onload = function () {
        bindmode();
        unbindmode();
        updatemode();
        frozen();
    };
    function bindmode(){
        var x = document.getElementsByClassName("bindmode");
        var i;
        for (i = 0; i < x.length; i++) {
            if (x[i].innerText == '0') {
                x[i].innerText = '绑机单开';
            } else if (x[i].innerText == '1') {
                x[i].innerText = '绑机多开';
            } else {
                x[i].innerText = '不绑机多开';
            }
        }
    }
    function unbindmode() {
        var x = document.getElementsByClassName("unbindmode");
        var i;
        for (i = 0; i < x.length; i++) {
            if (x[i].innerText == '0') {
                x[i].innerText = '允许解绑';
            } else if (x[i].innerText == '1') {
                x[i].innerText = '不允许解绑';
            }
        }
    }
    function updatemode() {
        var x = document.getElementsByClassName("updatemode");
        var i;
        for (i = 0; i < x.length; i++) {
            if (x[i].innerText == '0') {
                x[i].innerText = '强制更新';
            } else if (x[i].innerText == '1') {
                x[i].innerText = '提示更新';
            }
        }
    }
    function frozen() {
        var x = document.getElementsByClassName("frozen");
        var i;
        for (i = 0; i < x.length; i++) {
            if (x[i].innerText == '0') {
                x[i].innerText = '正常';
            } else if (x[i].innerText == '1') {
                x[i].innerText = '禁用';
            }
        }
    }
</script>
</html>